<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="People.aspx.cs" Inherits="People" %>

<asp:Content ID="Content1" ContentPlaceHolderID="header" Runat="Server">
  People
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="main" Runat="Server">
  <p>
    Search:
    <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
    <asp:Button ID="bnSearch" runat="server" Text="Search" onclick="bnSearch_Click" />
    <asp:Button ID="bnRemoveSearch" runat="server" Text="Cancel search" Visible="false" onclick="bnRemoveSearch_Click" />
  </p>
  <asp:GridView ID="gridPeople" runat="server" AllowPaging="True" 
    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" 
    DataSourceID="sdsPeople" ForeColor="#333333" GridLines="None" Width="100%" 
  onrowcommand="gridPeople_RowCommand">
    <RowStyle BackColor="#EFF3FB" />
    <Columns>
      <asp:ButtonField ButtonType="Button" CommandName="cmdEdit" Text="Edit" />

      <asp:BoundField DataField="first_name" HeaderText="First&nbsp;Name" 
        SortExpression="first_name" />
      <asp:BoundField DataField="last_name" HeaderText="Last&nbsp;Name" 
        SortExpression="last_name" />
      <asp:BoundField DataField="email" HeaderText="Email" SortExpression="email" />
      
      <asp:BoundField DataField="state" HeaderText="State" SortExpression="state" />
      <asp:BoundField DataField="involvement" HeaderText="Involvement" SortExpression="involvement" />

    </Columns>
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <EditRowStyle BackColor="#2461BF" />
    <AlternatingRowStyle BackColor="White" />
  </asp:GridView>
  <asp:SqlDataSource ID="sdsPeople" runat="server" 
    ConnectionString="<%$ ConnectionStrings:Main %>" 
    SelectCommand="SELECT * FROM [people] ORDER BY [last_name], [first_name], [id]">
  </asp:SqlDataSource>
</asp:Content>

